{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from tensorflow import keras\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import tensorflow.keras.datasets.mnist as mnist"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "(train_image,train_label),(test_image,test_label) = mnist.load_data()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(60000, 28, 28)"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_image.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "train_image = np.expand_dims(train_image,axis=-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "test_image = np.expand_dims(test_image,axis=-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(60000, 28, 28, 1)"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_image.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model = keras.Sequential()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.Conv2D(64,(3,3),activation='relu',input_shape=(28,28,1)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.MaxPool2D())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.Conv2D(64,(3,3),activation='relu'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.MaxPool2D())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.Flatten())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.Dense(256,activation=\"relu\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.Dropout(0.5))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.Dense(10,activation=\"softmax\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "conv2d_2 (Conv2D)            (None, 26, 26, 64)        640       \n",
      "_________________________________________________________________\n",
      "max_pooling2d_2 (MaxPooling2 (None, 13, 13, 64)        0         \n",
      "_________________________________________________________________\n",
      "conv2d_3 (Conv2D)            (None, 11, 11, 64)        36928     \n",
      "_________________________________________________________________\n",
      "max_pooling2d_3 (MaxPooling2 (None, 5, 5, 64)          0         \n",
      "_________________________________________________________________\n",
      "flatten_1 (Flatten)          (None, 1600)              0         \n",
      "_________________________________________________________________\n",
      "dense_2 (Dense)              (None, 256)               409856    \n",
      "_________________________________________________________________\n",
      "dropout_1 (Dropout)          (None, 256)               0         \n",
      "_________________________________________________________________\n",
      "dense_3 (Dense)              (None, 10)                2570      \n",
      "=================================================================\n",
      "Total params: 449,994\n",
      "Trainable params: 449,994\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.compile(optimizer='adam',loss='sparse_categorical_crossentropy' ,metrics=['acc'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 60000 samples, validate on 10000 samples\n",
      "Epoch 1/20\n",
      "60000/60000 [==============================] - 8s 139us/step - loss: 1.2673 - acc: 0.8662 - val_loss: 0.0650 - val_acc: 0.9797\n",
      "Epoch 2/20\n",
      "60000/60000 [==============================] - 8s 131us/step - loss: 0.0919 - acc: 0.9724 - val_loss: 0.0411 - val_acc: 0.9865\n",
      "Epoch 3/20\n",
      "60000/60000 [==============================] - 8s 131us/step - loss: 0.0659 - acc: 0.9800 - val_loss: 0.0393 - val_acc: 0.9870\n",
      "Epoch 4/20\n",
      "60000/60000 [==============================] - 8s 131us/step - loss: 0.0500 - acc: 0.9849 - val_loss: 0.0346 - val_acc: 0.9880\n",
      "Epoch 5/20\n",
      "60000/60000 [==============================] - 8s 131us/step - loss: 0.0403 - acc: 0.9877 - val_loss: 0.0303 - val_acc: 0.9908\n",
      "Epoch 6/20\n",
      "60000/60000 [==============================] - 8s 131us/step - loss: 0.0363 - acc: 0.9884 - val_loss: 0.0338 - val_acc: 0.9887\n",
      "Epoch 7/20\n",
      "60000/60000 [==============================] - 8s 131us/step - loss: 0.0329 - acc: 0.9895 - val_loss: 0.0260 - val_acc: 0.9927\n",
      "Epoch 8/20\n",
      "60000/60000 [==============================] - 8s 131us/step - loss: 0.0293 - acc: 0.9911 - val_loss: 0.0321 - val_acc: 0.9894\n",
      "Epoch 9/20\n",
      "60000/60000 [==============================] - 8s 130us/step - loss: 0.0245 - acc: 0.9919 - val_loss: 0.0310 - val_acc: 0.9917\n",
      "Epoch 10/20\n",
      "60000/60000 [==============================] - 8s 130us/step - loss: 0.0267 - acc: 0.9912 - val_loss: 0.0309 - val_acc: 0.9903\n",
      "Epoch 11/20\n",
      "60000/60000 [==============================] - 8s 130us/step - loss: 0.0266 - acc: 0.9914 - val_loss: 0.0323 - val_acc: 0.9919\n",
      "Epoch 12/20\n",
      "60000/60000 [==============================] - 8s 130us/step - loss: 0.0230 - acc: 0.9930 - val_loss: 0.0381 - val_acc: 0.9906\n",
      "Epoch 13/20\n",
      "60000/60000 [==============================] - 8s 130us/step - loss: 0.0210 - acc: 0.9934 - val_loss: 0.0356 - val_acc: 0.9905\n",
      "Epoch 14/20\n",
      "60000/60000 [==============================] - 8s 130us/step - loss: 0.0202 - acc: 0.9935 - val_loss: 0.0359 - val_acc: 0.9900\n",
      "Epoch 15/20\n",
      "60000/60000 [==============================] - 8s 130us/step - loss: 0.0194 - acc: 0.9938 - val_loss: 0.0312 - val_acc: 0.9912\n",
      "Epoch 16/20\n",
      "60000/60000 [==============================] - 8s 131us/step - loss: 0.0195 - acc: 0.9933 - val_loss: 0.0354 - val_acc: 0.9916\n",
      "Epoch 17/20\n",
      "60000/60000 [==============================] - 8s 131us/step - loss: 0.0181 - acc: 0.9943 - val_loss: 0.0364 - val_acc: 0.9915\n",
      "Epoch 18/20\n",
      "60000/60000 [==============================] - 8s 130us/step - loss: 0.0179 - acc: 0.9948 - val_loss: 0.0351 - val_acc: 0.9916\n",
      "Epoch 19/20\n",
      "60000/60000 [==============================] - 8s 131us/step - loss: 0.0204 - acc: 0.9938 - val_loss: 0.0327 - val_acc: 0.9912\n",
      "Epoch 20/20\n",
      "60000/60000 [==============================] - 8s 131us/step - loss: 0.0170 - acc: 0.9946 - val_loss: 0.0377 - val_acc: 0.9910\n"
     ]
    }
   ],
   "source": [
    "history = model.fit(train_image,train_label,epochs=20,batch_size=256,validation_data=(test_image,test_label))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x21d2f775588>"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAD8CAYAAABw1c+bAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt0VfWd9/H3FxIIAeSSRG5BgxaRu2JKqdOqS2oH7YXq\nMw7aWjvU1mGNl9o+nQ6jfWa6xq5ZdsbOVKuVxbR01Dq1LZbnoS3VqtAyU5EaBERuiqASEiBEDCDE\nXPg+f/x2yMnhhJyQk5xw9ue11l57n733Oed3dk4+e+/f/u3fMXdHRETio0+2CyAiIj1LwS8iEjMK\nfhGRmFHwi4jEjIJfRCRmFPwiIjGj4BcRiRkFv4hIzHQY/Ga2xMz2m9mr7Sw3M3vQzHaY2StmNiNh\n2Rwz2x4tW5jJgouIyOmxju7cNbPLgCPAY+4+JcXya4A7gGuADwEPuPuHzKwv8BpwFVAJvATc6O5b\nOipUcXGxl5WVdfKjiIjE17p16w64e0k66+Z1tIK7rzazslOsMpewU3DgRTMbamajgDJgh7vvBDCz\nJ6N1Owz+srIyKioqOi69iIgAYGZvpbtuJur4xwC7Ex5XRvPam5+Smd1qZhVmVlFTU5OBYomISCq9\n5uKuuy9293J3Ly8pSetsRURETkOHVT1p2AOMTXhcGs3Lb2e+iIhkUSaO+JcDN0ete2YBde5eTbiY\nO97MxplZP+CGaF0REcmiDo/4zeynwBVAsZlVAv9IOJrH3RcBKwgtenYAR4H50bImM7sdeAboCyxx\n983d8BlERKQT0mnVc2MHyx24rZ1lKwg7BhER6SV6zcVdERHp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Jof+Eu/8yebm7H3L3I9H0CiDfzIp7qnzuvica7weWEU6pE2V9GxL+kV52933JC7K9/SL7\nWqq/ovH+FOtkdTua2V8BnwQ+F+2cTpLGd6FbuPs+d2/20KHjf7TzvtnefnnAdcDP2lsnW9uvK87E\n4E+nC4nlwM1Ry5RZQF3CKXm3i+oEfwRsdfd/a2edkdF6mNlMwt+itofKN9DMBrdMEy4Cvpq0Wla3\nYaTdI61sbr8Ey4EvRNNfAP5finXS+b52Cws/oPQN4NPufrSdddL5LnRX+RKvGV3bzvtmbftFPgZs\nc/fKVAuzuf26JNtXl09nILQ4eY1wtf+eaN4CYEE0bYQfj3mD0E10eQ+X7yOE0/5XCL2WbojKnFjG\n24HNhFYKLwKX9mD5zoved2NUht64DQcSgnxIwrysbT/CDqgaaCTUM98CFAHPA68DzwHDo3VHAytO\n9X3tofLtINSPt3wHFyWXr73vQg+V7/Hou/UKIcxH9abtF83/z5bvXMK6Pb79Mj3ozl0RkZg5E6t6\nRESkCxT8IiIxo+AXEYkZBb+ISMwo+EVEYkbBLyISMwp+EZGYUfCLiMTM/wd+9d3UE//UHAAAAABJ\nRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x21d3d775198>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(history.epoch,history.history.get('acc'),c=\"r\",label=\"acc\")\n",
    "plt.plot(history.epoch,history.history.get('val_acc'),c=\"b\",label=\"val_acc\")\n",
    "plt.legend()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:kr]",
   "language": "python",
   "name": "conda-env-kr-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
